from flask import Flask, render_template
import json


app = Flask(__name__)


@app.route('/')
def hello_world():
    return render_template('index.html')


@app.route('/car_up', methods=['get'])
def car_up():

    car = {}
    car['dong'] = 'up'
    print('up')
    return json.dumps(car)


@app.route('/car_left', methods=['get'])
def car_left():

    car = {}
    car['dong'] = 'left'
    print('left')
    return json.dumps(car)

@app.route('/car_right', methods=['get'])
def car_right():

    car = {}
    car['dong'] = 'right'
    print('right')
    return json.dumps(car)

@app.route('/car_down', methods=['get'])
def car_down():

    car = {}
    car['dong'] = 'down'
    print('down')
    return json.dumps(car)


if __name__ == '__main__':
    app.run()
